load("//bzl:cpp_library.bzl", "cpp_library")

package(default_visibility = ["//visibility:public"])

cpp_library(
    name = "transport_callback_base",
    hdrs = [
        "TransportCallbackBase.h",
    ],
    deps = [
        "//folly:portability",
        "//folly/coro:baton",
        "//folly/coro:task",
        "//folly/io/async:async_transport",
        "//folly/io/async/ssl:ssl_errors",
    ],
)

cpp_library(
    name = "transport_callbacks",
    hdrs = [
        "TransportCallbacks.h",
    ],
    deps = [
        ":transport_callback_base",
        "//folly:network_address",
        "//folly:range",
        "//folly/coro:task",
        "//folly/io:iobuf",
        "//folly/io/async:async_socket",
        "//folly/io/async:async_socket_exception",
    ],
)

cpp_library(
    name = "socket",
    srcs = [
        "ServerSocket.cpp",
        "Transport.cpp",
    ],
    hdrs = [
        "ServerSocket.h",
        "Transport.h",
    ],
    deps = [
        ":transport_callbacks",
        "//folly:exception_wrapper",
        "//folly:expected",
        "//folly:network_address",
        "//folly:portability",
        "//folly:range",
        "//folly/coro:baton",
        "//folly/coro:task",
        "//folly/io:iobuf",
        "//folly/io/async:async_socket",
        "//folly/io/async:async_socket_exception",
        "//folly/io/async:server_socket",
    ],
)
